﻿using System.Collections.Generic;
using System.Web.Security;

namespace TSharp.Core.Authentication.Facade
{
    internal static class SeviceExtend
    {
        public static IUser ToIUser(this MembershipUser user)
        {
            return CoverrtToIUser(user);
        }

        private static IUser CoverrtToIUser(MembershipUser user)
        {
            return user as IUser;
        }

        public static List<IUser> ToList(this MembershipUserCollection list)
        {
            var users = new List<IUser>();
            foreach (MembershipUser user in list)
            {
                users.Add(user.ToIUser());
            }
            return users;
        }
    }
}